﻿<UserControl x:Class="CalculatorMVVM.Views.Calculator"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewModel="clr-namespace:CalculatorMVVM.ViewModels"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <UserControl.DataContext>
        <viewModel:ViewModelCalculator></viewModel:ViewModelCalculator>
    </UserControl.DataContext>
    <Border HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10, 20" BorderThickness="3" BorderBrush="Black"
            CornerRadius="10">
    <Grid Width="200" Height="100">
        <Grid.RowDefinitions>
            <RowDefinition Height="40"></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <TextBox Margin="5" Name="TextBoxInputAndResult" Text="{Binding CurrentValue, Mode=TwoWay}" Grid.Row="0" Grid.ColumnSpan="7" MaxLines="1"></TextBox>
            <Button Grid.Row="1" Grid.Column="0" Name="ButtonPlus" Content="+" Command="{Binding AdditionCommand}"></Button>
            <Button Grid.Row="1" Grid.Column="1" Name="ButtonSubstract" Content="-"></Button>
            <Button Grid.Row="1" Grid.Column="2" Name="ButtonMultiply" Content="/"></Button>
            <Button Grid.Row="1" Grid.Column="3" Name="ButtonDivide" Content="*"></Button>
            <Button Grid.Row="1" Grid.Column="4" Name="ButtonLog" Content="log"></Button>
            <Button Grid.Row="1" Grid.Column="5" Name="ButtonSqrt" Content="√"></Button>
            <Button Grid.Row="1" Grid.Column="6" Name="ButtonPower">
                <Button.Content>
                    <Span >
                        <Span>x</Span>
                        <Span BaselineAlignment="Superscript">n</Span>
                    </Span>
                </Button.Content>
            </Button>
            <Button Grid.Row="2" Grid.Column="0" Content="M+" Name="ButtonMemory"></Button>
            <Button Grid.Row="2" Grid.Column="1" Content="Mr" Name="ButtonMemoryRecall"></Button>
            <Button Grid.Row="2" Grid.Column="6" Content="=" Command="{Binding EqualsCommand}" Name="ButtonEquals"></Button>
            <Button Grid.Row="2" Grid.Column="4" Content="C" Name="ButtonClear"></Button>
            <Button Grid.Row="2" Grid.Column="3" Content="CE" Name="ButtonClearE"></Button>

        </Grid>
    </Border>
</UserControl>
